from turtle import*
import time

# 设置抬笔跳跃
def my_goto(x, y):
    penup()
    goto(x, y)
    pendown()
# 绘制项圈
def collar():
    color("red")
    pencolor("black")
    begin_fill()
    my_goto(-100, 0)
    lt(10)
    circle(-800, 20)
    rt(70)
    fd(10)
    goto(-100, -10)
    goto(-100, 0)
    end_fill()
# 绘制大脸
def face():
    color("sky blue")
    pencolor("black")
    begin_fill()
    lt(46)
    circle(251,-293)
    lt(10)
    circle(200,273)
    end_fill()
# 绘制眼睛
def eyes():
    # 绘制左眼
    my_goto(-45,338)
    color("white")
    begin_fill()
    pencolor("black")

    tracer(False)
    a = 3
    rt(45)
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            a -= 0.05
            lt(3)
            fd(a)
        else:
            a += 0.05
            lt(3)
            fd(a)
    tracer(True)
    end_fill()
    # 绘制左眼球
    color("black")
    begin_fill()
    pencolor("black")
    my_goto(-5, 320)
    circle(15)
    end_fill()

    color("white")
    begin_fill()
    my_goto(10, 318)
    circle(5)
    end_fill()

    # 绘制右眼
    my_goto(45,338)
    color("white")
    begin_fill()
    pencolor("black")

    tracer(False)
    a = 3
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            a -= 0.05
            lt(3)
            fd(a)
        else:
            a += 0.05
            lt(3)
            fd(a)
    tracer(True)
    end_fill()
    # 绘制右黑眼球
    color("black")
    begin_fill()
    pencolor("black")
    my_goto(50,320)
    circle(15)
    end_fill()

    color("white")
    begin_fill()
    my_goto(54, 318)
    circle(5)
    end_fill()
# 绘制鼻子
def nose():
    pensize(3)
    color("red")
    begin_fill()
    pencolor("black")
    my_goto(4,272)
    circle(35)
    end_fill()
    # 绘制鼻尖
    color("white")
    begin_fill()
    my_goto(33, 290)
    circle(5)
    end_fill()
# 绘制嘴巴
def mouse():
    pencolor("black")
    my_goto(38,202)
    goto(38,50)
    my_goto(-110,160)
    lt(15)
    circle(150,150)
# 绘制胡子
def beard():
    pencolor("black")
    pensize(4)

    # 绘制左边的胡子
    my_goto(-120,200)
    goto(-20,180)

    my_goto(-120, 170)
    goto(-20,160)

    my_goto(-120, 130)
    goto(-20,140)

    # 绘制右边的胡子
    my_goto(196,200)
    goto(96,180)

    my_goto(196, 170)
    goto(96,160)

    my_goto(196, 130)
    goto(96,140)
# 绘制猫身
def body():
    color("sky blue")
    begin_fill()
    pencolor("black")
    # 左半边的身子
    my_goto(-100, -10)
    rt(35)
    fd(-180)
    circle(-50,-180)
    fd(-80)
    lt(50)
    fd(-60)
    fd(190)
    rt(30)
    fd(60)
    lt(115)
    fd(80)
    lt(10)
    fd(65)
    #机器猫的裤裆
    lt(90)
    circle(-35,190)
    lt(90)
    fd(65)
    rt(-10)
    fd(80)
    # 右半边的身子
    lt(115)
    fd(60)
    rt(35)
    fd(190)
    fd(-60)
    rt(60)
    fd(180)
    circle(50,180)
    goto(185,-10)
    goto(-100, -10)

    end_fill()
# 绘制猫肚子
def belly():
    color("white")
    pencolor("black")
    begin_fill()
    my_goto(-80,-10)
    seth(0)
    lt(80)
    circle(-120, -200)
    end_fill()

    my_goto(-10,-70)
    seth(0)
    lt(80)
    circle(-50, -200)
    goto(-10,-70)
# 绘制铃铛
def bell():
    my_goto(38,-10)
    seth(180)
    color("yellow")
    begin_fill()
    pencolor("black")

    circle(20)

    end_fill()
# 绘制双手
def hand():
    # 绘制左手
    color("white")
    begin_fill()
    pencolor("black")
    my_goto(-230,-125)
    circle(60)
    end_fill()
    # 绘制右手
    color("white")
    begin_fill()
    pencolor("black")
    my_goto(380, 50)
    circle(60)
    end_fill()
# 绘制双脚
def foot():
    # 绘制左脚
    color("white")
    begin_fill()
    pencolor("black")
    my_goto(-10, -330)
    seth(0)
    fd(10)
    circle(-35, 180)
    fd(140)
    circle(-35, 180)
    # fd(10)
    goto(-10,-330)
    end_fill()
    # 绘制右脚
    color("white")
    begin_fill()
    pencolor("black")
    my_goto(220, -330)
    seth(0)
    fd(10)
    circle(-35, 180)
    fd(140)
    circle(-35, 180)
    # fd(10)
    goto(220,-330)
    end_fill()
# 署名及日期落款
def auther_name():
    my_goto(380, 150)
    write('Go! GO! ---2021/12/26', font=("Bradley Hand ITC", 18, "bold"))
# 调用函数
def main():
    hideturtle()
    speed(2)
    pensize(3)

    collar()
    face()
    eyes()
    nose()
    mouse()
    beard()
    body()
    belly()
    bell()
    hand()
    foot()
    auther_name()
    exitonclick()

if __name__ == '__main__':
    main()
time.sleep(20)   #停止20s